const GlobalApiHeader = '/api/global'

export const GlobalApi = {
  uuid: `${GlobalApiHeader}/uuid`,
  csrf: `${GlobalApiHeader}/csrf`,
  verificationCode: `${GlobalApiHeader}/verification-code`
}

const UserApiHeader = '/api/user'
const UserAuthApiHeader = '/auth/user'
const UserSuperAuthApiHeader = '/super-auth/user'

export const UserApi = {
  resetPass: `${UserApiHeader}/reset-pass`,
  login: `${UserApiHeader}/login`,
  sessionLogin: `${UserAuthApiHeader}/session-login`,
  logut: `${UserAuthApiHeader}/logut`,
  updatePass: `${UserAuthApiHeader}/update-password`,
  crud: UserSuperAuthApiHeader,
  updateEnabled: `${UserSuperAuthApiHeader}/update-enabled`,
  updateUserPass: `${UserSuperAuthApiHeader}/update-user-password`,
  addProject: `${UserSuperAuthApiHeader}/add-project`,
  removeProject: `${UserSuperAuthApiHeader}/remove-project`,
  projectList: `${UserAuthApiHeader}/project-list`,
}

const ProjectAuthApiHeader = '/auth/project'
const ProjectSuperAuthApiHeader = '/super-auth/project'

export const ProjectApi = {
  crud: ProjectSuperAuthApiHeader,
  all: `${ProjectSuperAuthApiHeader}/all`,
  detail: ProjectAuthApiHeader
}

const EnumSuperAuthApiHeader = '/super-auth/enum'
const EnumAuthApiHeader = '/auth/enum'

export const EnumApi = {
  create: EnumSuperAuthApiHeader,
  update: `${EnumSuperAuthApiHeader}/update`,
  remoce: EnumSuperAuthApiHeader,
  detail: EnumAuthApiHeader,
  updataDataShow: `${EnumSuperAuthApiHeader}/update/data-show`
}

const DataAuthApiHeader = '/auth/data'
const DataSuperAuthApiHeader = '/super-auth/data'

export const DataApi = {
  updateOne: `${DataAuthApiHeader}/update-one`, // 更新单条数据
  getOne: `${DataAuthApiHeader}/one`, // 更新单条数据
  recordList: `${DataAuthApiHeader}/record`,
  removeRecord: `${DataSuperAuthApiHeader}/record`,
  restoreOne: `${DataAuthApiHeader}/one/restore`,
  dataArrayPush: `${DataAuthApiHeader}/array`,
  dataArrayList: `${DataAuthApiHeader}/array`,
  dataArrayUpdate: `${DataAuthApiHeader}/array/update`,
  arrayListRecyclePush: `${DataAuthApiHeader}/array/recycle-push`,
  arrayListRecyclePop: `${DataAuthApiHeader}/array/recycle-pop`,
  removeData: `${DataSuperAuthApiHeader}`,
}

const DataApiHeader = '/api/data'

export const GetDataApi = {
  getOneData: `${DataApiHeader}/one`,
  getOnesData: `${DataApiHeader}/ones`,
  getArrayData: `${DataApiHeader}/array`
}



export const nginxHeader = process.env.VUE_APP_NGINX_HEADER
